package br.com.hbt.polimorfismo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Vector;

public class Gato extends Mamifero implements Comparable {

	public Integer qtd = 0;

	private static final long serialVersionUID = 1L;

	public Gato() {
	}

	public Gato(Integer qtd) {
		this.qtd = qtd;
	}

	public String capture() {
		return "Gato";
		// System.out.print("Gato");
	}

	public static void main(String... args) {
		Gato gato = new Gato();
		System.out
				.println("Instancia Gato, Referencia Gato: " + gato.capture());

		Animal animal = new Mamifero();
		System.out.println("Instancia Animal, Referencia Mamifero: "
				+ animal.capture());

		Gato[] gs = new Gato[] { new Gato(6), new Gato(4), new Gato(1) };
		Arrays.sort(gs);
		for (Gato g : gs) {
			System.out.println(g);
		}

	}

	public String toString() {
		return "[" + this.qtd + "]";
	}

	@Override
	public int compareTo(Object o) {
		if (this.qtd == ((Gato) o).qtd) {
			return 0;
		}
		return 1;
	}

	public static void teste() {

		List<String> lst1 = new Vector();
		List lst2 = new Vector<String>();

		System.out.println(lst1);
		System.out.println(lst2);
	}

}
